#!/bin/bash

cd /etc/yum.repos.d/

rm -rvf *

cat >>centos.repo<<OK
[centos]
name=centos
baseurl=file:///opt/centos
gpgcheck=0
enable=1
OK

cd

mount -o loop CentOS-7-x86_64-DVD-1511.iso /mnt/
mkdir /opt/centos
cp -rvf /mnt/* /opt/centos
umount /mnt/

yum clean all
yum install vsftpd -y
sed -i '$ianon_root=/opt/' /etc/vsftpd/vsftpd.conf

systemctl restart vsftpd
systemctl enable vsftpd

sed -i 's/SELINUX=enforcing/SELINUX=permissive/g' /etc/selinux/config

systemctl stop firewalld.service
systemctl disable firewalld.service
iptables -F
iptables -X
iptables -Z
service iptables save